<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>xmake v2.5.5 发布，支持下载集成二进制镜像包</title>
    <meta name="description" content="xmake 是一个基于 Lua 的轻量级跨平台构建工具，使用 xmake.lua 维护项目构建，相比 makefile/CMakeLists.txt，配置语法更加简洁直观，对新手非常友好，短时间内就能快速入门，能够让用户把更多的精力集中在实际的项目开发上。2.5.5 版本中，我们继续改进远程包集成的体验，实现在云...">

    
    <meta name="keywords" content="xmake,lua,C/C++,mirror,package,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/cn/2021/06/30/xmake-update-v2.5.5/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />

    <!-- css -->
    <link href="/css/reward.css" rel="stylesheet" type="text/css"> 




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/cn" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/?lang=0">
                    
                        <i class="fa fa-home"></i>English
                    </a>
                </li>

                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>项目
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/archive/">
                            
                        
                            <i class="fa fa-archive"></i>归档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/category/">
                            
                        
                            <i class="fa fa-th-list"></i>分类
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/tag/">
                            
                        
                            <i class="fa fa-tags"></i>标记
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/docs/">
                            
                        
                            <i class="fa fa-book"></i>文档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="https://xmake.io/#/zh-cn/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>社区
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/donation/">
                            
                        
                            <i class="fa fa-heart"></i>捐助
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/about/">
                            
                        
                            <i class="fa fa-user"></i>关于
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>xmake v2.5.5 发布，支持下载集成二进制镜像包</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2021-06-30
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/cn/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a-->
        <a href="/cn/tag/#lua" title="Tag: lua" rel="tag">lua</a>&nbsp;
    
        <!--a href="/tag/#C%2FC%2B%2B" title="Tag: C/C++" rel="tag">C/C++</a-->
        <a href="/cn/tag/#C/C++" title="Tag: C/C++" rel="tag">C/C++</a>&nbsp;
    
        <!--a href="/tag/#mirror" title="Tag: mirror" rel="tag">mirror</a-->
        <a href="/cn/tag/#mirror" title="Tag: mirror" rel="tag">mirror</a>&nbsp;
    
        <!--a href="/tag/#package" title="Tag: package" rel="tag">package</a-->
        <a href="/cn/tag/#package" title="Tag: package" rel="tag">package</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <p><a href="https://github.com/xmake-io/xmake">xmake</a> 是一个基于 Lua 的轻量级跨平台构建工具，使用 xmake.lua 维护项目构建，相比 makefile/CMakeLists.txt，配置语法更加简洁直观，对新手非常友好，短时间内就能快速入门，能够让用户把更多的精力集中在实际的项目开发上。</p>

<p>2.5.5 版本中，我们继续改进远程包集成的体验，实现在云端预编译包，然后直接下载集成预编译的二进制包。这对于一些编译非常慢的包，可以极大的减少包的安装时间。</p>

<p>另外，新版本中，我们还重新实现了新版的本地包生成方案，完全无缝支持 <code class="highlighter-rouge">add_requires</code> 和 <code class="highlighter-rouge">add_packages</code>，从此远程包和本地包可以使用统一的集成方式来维护。</p>

<ul>
  <li><a href="https://github.com/xmake-io/xmake">项目源码</a></li>
  <li><a href="https://xmake.io/#/zh-cn/">官方文档</a></li>
  <li><a href="https://xmake.io/#/zh-cn/about/course">入门课程</a></li>
</ul>

<h2 id="新特性介绍">新特性介绍</h2>

<h3 id="下载安装预编译包">下载安装预编译包</h3>

<p>之前 xmake 内置的包管理器每次安装包，都必须下载对应的包源码，然后执行本地编译安装集成，这对于一些编译非常慢的大包，以及一些依赖的编译工具非常多的包，安装起来会非常的慢。</p>

<p>尤其是在 windows 上，不仅三方包对编译环境的依赖更加复杂，而且很多打包编译非常慢，例如：boost, openssl 等等。</p>

<p>为此，我们基于 github action 实现对包的云端预编译，会将常用配置的包都去预编译一遍，然后存储到 <a href="https://github.com/xmake-mirror/build-artifacts">build-artifacts</a> 仓库的 Releases 下。</p>

<p>然后，我们在安装包的时候，会自动从二进制镜像包源下载，实现快速集成（目前仅支持预编译 windows 包，后期会逐步放开到其他平台）。</p>

<p>我们会预编译每个包的 plat/arch/MT/MD/static/shared 等各种配置组合，根据唯一的 buildhash 来精确拉取用户实际需要的包，所有的编译产物都会用 7zip 压缩打包，如下图：</p>

<p><img src="/static/img/xmake/build-artifacts.png" alt="" /></p>

<h4 id="配置镜像源加速下载">配置镜像源加速下载</h4>

<p>由于我们的预编译产物都放置在 github 上，对于国内用户，考虑到访问 github 并不是很稳定，我们也可以借助 xmake 镜像代理功能，将实际的下载自动切换到 fastgit 等镜像站点加速下载。</p>

<p>我们可以通过一个 pac.lua 文件，配置镜像代理规则，比如对所有 github.com 域名的访问切到 hub.fastgit.org 域名，实现加速下载包。</p>

<p>pac.lua 配置：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="k">function</span> <span class="nf">mirror</span><span class="p">(</span><span class="n">url</span><span class="p">)</span>
     <span class="k">return</span> <span class="n">url</span><span class="p">:</span><span class="n">gsub</span><span class="p">(</span><span class="s2">"github.com"</span><span class="p">,</span> <span class="s2">"hub.fastgit.org"</span><span class="p">)</span>
<span class="k">end</span>
</code></pre>
</div>

<p>然后我们设置这个 pac.lua 文件，默认路径在 <code class="highlighter-rouge">~/.xmake/pac.lua</code>，也可以手动配置使用指定位置的 pac.lua 。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> g --proxy_pac=/tmp/pac.lua
</span></code></pre>
</div>

<p>然后，我们安装包的时候，如果遇到 github.com 域名下的包源，下载时候会自动切到 fastgit 镜像加速下载。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install libpng
</span>&gt; curl https://hub.fastgit.org/glennrp/libpng/archive/v1.6.37.zip -o v1.6.37.zip
</code></pre>
</div>

<p>因此，所有走预编译产物的下载也会得到提速，当然国内提供 github 镜像加速的不止 fastgit 一家，用户也可以切换到其他镜像源，比如 cnpmjs.org 等等。</p>

<h4 id="如何触发云端预编译">如何触发云端预编译</h4>

<p>默认情况下，xmake 不会主动进行所有包的云端预编译缓存，这样太耗时耗力，目前仅仅只有提交 pr 到 <a href="https://github.com/xmake-io/xmake-repo">xmake-repo</a> 官方包仓库，进行新包收录或者包版本更新时候，才会自动触发对应包的云端预编译行为。</p>

<p>所以，如果用户想要贡献包进我们的仓库，基本上都是可以被预编译缓存的（除了 headeronly 库），而如果用户不想贡献包，也想获取对应包的预编译加速，也是可以的。</p>

<p>只需要提交 pr 到 <a href="https://github.com/xmake-mirror/build-artifacts">build-artifacts</a> 仓库的 build 分支，编辑 <a href="https://github.com/xmake-mirror/build-artifacts/blob/build/build.txt">build.txt</a> 文件，修改里面需要触发预编译的包名和版本列表就行了，例如：</p>

<p>build.txt</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="p">{</span>
    <span class="n">name</span> <span class="o">=</span> <span class="s2">"asmjit"</span><span class="p">,</span>
    <span class="n">versions</span> <span class="o">=</span> <span class="p">{</span>
        <span class="s2">"2021.06.27"</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre>
</div>

<p>只要 pr 被 merge 之后，就会自动触发预编译行为，然后生成最终的编译产物到 releases 。</p>

<h4 id="强制源码编译安装">强制源码编译安装</h4>

<p>尽管我们提供了预编译下载安装的方式，但是如果用户还是想源码编译安装，我们也可以手动传入 <code class="highlighter-rouge">--build</code> 参数给 xrepo 命令，来强制切换到源码编译安装模式。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> install --build openssl
</span></code></pre>
</div>

<p>在 xmake.lua 中，我们也可以同样支持源码编译安装。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"openssl"</span><span class="p">,</span> <span class="p">{</span><span class="n">build</span> <span class="o">=</span> <span class="kc">true</span><span class="p">})</span>
</code></pre>
</div>

<p>如果没有指定，那么 xmake 会自动优先尝试走预编译包的下载安装。</p>

<h4 id="添加私有预编译包仓库">添加私有预编译包仓库</h4>

<p>我们的官方预编译包仓库在：<a href="https://github.com/xmake-mirror/build-artifacts">build-artifacts</a>。</p>

<p>同样，我们也可以配置添加自有的预编译仓库，添加方式类似：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> repo --add local-repo git@github.com:xmake-mirror/myrepo-artifacts.git
</span></code></pre>
</div>

<p>也可以在 xmake.lua 中添加：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_repositories</span><span class="p">(</span><span class="s2">"local-repo git@github.com:xmake-mirror/myrepo-artifacts.git"</span><span class="p">)</span>
</code></pre>
</div>

<h3 id="新版本地包方案">新版本地包方案</h3>

<h4 id="默认打包格式">默认打包格式</h4>

<p>新版本中，我们提供了一种新的本地包打包方案，将会更加无缝的对接 <code class="highlighter-rouge">add_requires</code> 和 <code class="highlighter-rouge">add_packages</code>。</p>

<p>我们执行 <code class="highlighter-rouge">xmake package</code> 命令就能够生成默认的新版打包格式。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> package
</span>package(foo): build/packages/f/foo generated
</code></pre>
</div>

<p>它将会产生 <code class="highlighter-rouge">build/packages/f/foo/xmake.lua</code> 文件，内容如下：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">package</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
    <span class="n">set_description</span><span class="p">(</span><span class="s2">"The foo package"</span><span class="p">)</span>
    <span class="n">set_license</span><span class="p">(</span><span class="s2">"Apache-2.0"</span><span class="p">)</span>
    <span class="n">add_deps</span><span class="p">(</span><span class="s2">"add"</span><span class="p">,</span> <span class="s2">"sub"</span><span class="p">)</span>

    <span class="n">on_load</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">package</span><span class="p">)</span>
        <span class="n">package</span><span class="p">:</span><span class="n">set</span><span class="p">(</span><span class="s2">"installdir"</span><span class="p">,</span> <span class="n">path</span><span class="p">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">scriptdir</span><span class="p">(),</span> <span class="n">package</span><span class="p">:</span><span class="n">plat</span><span class="p">(),</span> <span class="n">package</span><span class="p">:</span><span class="n">arch</span><span class="p">(),</span> <span class="n">package</span><span class="p">:</span><span class="n">mode</span><span class="p">()))</span>
    <span class="k">end</span><span class="p">)</span>

    <span class="n">on_fetch</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">package</span><span class="p">)</span>
        <span class="kd">local</span> <span class="n">result</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="n">result</span><span class="p">.</span><span class="n">links</span> <span class="o">=</span> <span class="s2">"foo"</span>
        <span class="n">result</span><span class="p">.</span><span class="n">linkdirs</span> <span class="o">=</span> <span class="n">package</span><span class="p">:</span><span class="n">installdir</span><span class="p">(</span><span class="s2">"lib"</span><span class="p">)</span>
        <span class="n">result</span><span class="p">.</span><span class="n">includedirs</span> <span class="o">=</span> <span class="n">package</span><span class="p">:</span><span class="n">installdir</span><span class="p">(</span><span class="s2">"include"</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">result</span>
    <span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<p>其实就是采用 <code class="highlighter-rouge">package()</code> 来定义描述本地包，就跟远程包一样。</p>

<p>而生成的目录结构如下：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">tree</span><span class="kv"> build/packages/f/foo/
</span>build/packages/f/foo/
├── macosx
│   └── x86_64
│       └── release
│           ├── include
│           │   └── foo.h
│           └── lib
│               └── libfoo.a
└── xmake.lua
</code></pre>
</div>

<p>我们也能够使用 <code class="highlighter-rouge">add_requires</code>/<code class="highlighter-rouge">add_repositories</code> 接口来无缝集成这个包。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_rules</span><span class="p">(</span><span class="s2">"mode.debug"</span><span class="p">,</span> <span class="s2">"mode.release"</span><span class="p">)</span>

<span class="n">add_repositories</span><span class="p">(</span><span class="s2">"local-repo build"</span><span class="p">)</span>
<span class="n">add_requires</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>

<span class="n">target</span><span class="p">(</span><span class="s2">"bar"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.cpp"</span><span class="p">)</span>
    <span class="n">add_packages</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
</code></pre>
</div>

<p>其中，<code class="highlighter-rouge">add_repositories</code> 配置指定本地包的仓库根目录，然后就可以通过 <code class="highlighter-rouge">add_requires</code> 来引用这个包了。</p>

<p>另外，生成的本地包，还有一个特性，就是支持 <code class="highlighter-rouge">target/add_deps</code>，会自动关联多个包的依赖关系，集成时候，也会自动对接所有依赖链接。</p>

<p>这里有完整的<a href="https://github.com/xmake-io/xmake/blob/dev/tests/actions/package/localpkg/test.lua">测试例子</a>。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code>"/usr/bin/xcrun -sdk macosx clang++" -o build/macosx/x86_64/release/bar build/.objs/bar/macosx/x86_64/release/src/main.cpp.o -arch x86_64 -mmacosx-version-min=10.15 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -stdlib=libc++
 -L/Users/ruki/projects/personal/xmake/tests/actions/package/localpkg/bar/build/packages/f/foo/macosx/x86_64/release/lib
 -L/Users/ruki/projects/personal/xmake/tests/actions/package/localpkg/bar/build/packages/s/sub/macosx/x86_64/release/lib
 -L/Users/ruki/projects/personal/xmake/tests/actions/package/localpkg/bar/build/packages/a/add/macosx/x86_64/release/lib
 -Wl,-x -lfoo -lsub -ladd -lz
</code></pre>
</div>

<p>备注：之前的老版本本地打包格式属于早期产物，还是会被保留，但是不推荐继续使用，想要继续使用，可以执行下面的命令打包：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> package -f oldpkg
</span></code></pre>
</div>

<h4 id="生成远程包">生成远程包</h4>

<p>除了本地包格式，<code class="highlighter-rouge">xmake package</code> 现在也支持生成远程包，便于用户将他们快速提交到远程仓库。</p>

<p>我们只需要在打包时候，修改包格式。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> package -f remote
</span></code></pre>
</div>

<p>他也会产生 packages/f/foo/xmake.lua 文件。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">package</span><span class="p">(</span><span class="s2">"foo"</span><span class="p">)</span>
    <span class="n">set_description</span><span class="p">(</span><span class="s2">"The foo package"</span><span class="p">)</span>
    <span class="n">set_license</span><span class="p">(</span><span class="s2">"Apache-2.0"</span><span class="p">)</span>
    <span class="n">add_deps</span><span class="p">(</span><span class="s2">"add"</span><span class="p">,</span> <span class="s2">"sub"</span><span class="p">)</span>

    <span class="n">add_urls</span><span class="p">(</span><span class="s2">"https://github.com/myrepo/foo.git"</span><span class="p">)</span>
    <span class="n">add_versions</span><span class="p">(</span><span class="s2">"1.0"</span><span class="p">,</span> <span class="s2">"&lt;shasum256 or gitcommit&gt;"</span><span class="p">)</span>

    <span class="n">on_install</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">package</span><span class="p">)</span>
        <span class="kd">local</span> <span class="n">configs</span> <span class="o">=</span> <span class="p">{}</span>
        <span class="k">if</span> <span class="n">package</span><span class="p">:</span><span class="n">config</span><span class="p">(</span><span class="s2">"shared"</span><span class="p">)</span> <span class="k">then</span>
            <span class="n">configs</span><span class="p">.</span><span class="n">kind</span> <span class="o">=</span> <span class="s2">"shared"</span>
        <span class="k">end</span>
        <span class="n">import</span><span class="p">(</span><span class="s2">"package.tools.xmake"</span><span class="p">).</span><span class="n">install</span><span class="p">(</span><span class="n">package</span><span class="p">,</span> <span class="n">configs</span><span class="p">)</span>
    <span class="k">end</span><span class="p">)</span>

    <span class="n">on_test</span><span class="p">(</span><span class="k">function</span> <span class="p">(</span><span class="n">package</span><span class="p">)</span>
        <span class="c1">-- TODO check includes and interfaces</span>
        <span class="c1">-- assert(package:has_cfuncs("foo", {includes = "foo.h"})</span>
    <span class="k">end</span><span class="p">)</span>
</code></pre>
</div>

<p>包定义配置相比本地包，多了实际的安装逻辑，以及 urls 和 versions 的设置，</p>

<p>我们也能够通过附加参数，去修改 urls，versions 等配置值，例如：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> package -f remote --url=https://xxxx/xxx.tar.gz --shasum=xxxxx --homepage=xxxxx`
</span></code></pre>
</div>

<p>xmake 也会从 target 的 <code class="highlighter-rouge">set_license</code> 和 <code class="highlighter-rouge">set_version</code> 等配置中读取相关配置信息。</p>

<h3 id="从第三方仓库搜索包">从第三方仓库搜索包</h3>

<p>xmake 内置的 xrepo 包管理器命令，之前可以支持搜索 xmake-repo 仓库中的内置包。</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> search zlib "pcr*"
</span>    zlib:
      -&gt; zlib: A Massively Spiffy Yet Delicately Unobtrusive Compression Library (in xmake-repo)
    pcr*:
      -&gt; pcre2: A Perl Compatible Regular Expressions Library (in xmake-repo)
      -&gt; pcre: A Perl Compatible Regular Expressions Library (in xmake-repo)
</code></pre>
</div>

<p>而现在，我们还可以从 vcpkg, conan, conda 以及 apt 等第三方包管理器中搜索它们的包，只需要加上对应的包命名空间就行，例如：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> search vcpkg::pcre
</span>The package names:
    vcpkg::pcre:
      -&gt; vcpkg::pcre-8.44#8: Perl Compatible Regular Expressions
      -&gt; vcpkg::pcre2-10.35#2: PCRE2 is a re-working of the original Perl Compatible Regular Expressions library
</code></pre>
</div>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> search conan::openssl
</span>The package names:
    conan::openssl:
      -&gt; conan::openssl/1.1.1g:
      -&gt; conan::openssl/1.1.1h:
</code></pre>
</div>

<h3 id="修改目标文件名">修改目标文件名</h3>

<p>我们知道，对于目标文件名的修改，我们可以使用 <code class="highlighter-rouge">set_basename</code> 或者使用 <code class="highlighter-rouge">set_filename</code> 接口来配置实现，前者修改 <code class="highlighter-rouge">libxxx.so</code> 中的 <code class="highlighter-rouge">xxx</code> 部分名字，后者可以修改完整的文件名。</p>

<p>但是有些情况，我们仅仅想要修改：扩展名 <code class="highlighter-rouge">.so</code>，前缀名 <code class="highlighter-rouge">lib</code>，或者增加后缀名比如：<code class="highlighter-rouge">libxxx-d.so</code> 就会很麻烦，要么使用 <code class="highlighter-rouge">set_filename</code> 进行完整修改。</p>

<p>现在，我们新提供了 <code class="highlighter-rouge">set_prefixname</code>, <code class="highlighter-rouge">set_suffixname</code> 和 <code class="highlighter-rouge">set_extension</code> 三个独立接口来更加灵活地配置它们。</p>

<h4 id="设置目标文件的前置名">设置目标文件的前置名</h4>

<p>例如将默认的：<code class="highlighter-rouge">libtest.so</code> 改成 <code class="highlighter-rouge">test.so</code></p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_prefixname</span><span class="p">(</span><span class="s2">""</span><span class="p">)</span>
</code></pre>
</div>

<h4 id="设置目标文件的后置名">设置目标文件的后置名</h4>

<p>例如将默认的：<code class="highlighter-rouge">libtest.so</code> 改成 <code class="highlighter-rouge">libtest-d.so</code></p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_suffixname</span><span class="p">(</span><span class="s2">"-d"</span><span class="p">)</span>
</code></pre>
</div>

<h4 id="设置目标文件的扩展名">设置目标文件的扩展名</h4>

<p>例如将默认的：<code class="highlighter-rouge">libtest.so</code> 改成 <code class="highlighter-rouge">test.dll</code></p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_prefixname</span><span class="p">(</span><span class="s2">""</span><span class="p">)</span>
    <span class="n">set_extension</span><span class="p">(</span><span class="s2">".dll"</span><span class="p">)</span>
</code></pre>
</div>

<h3 id="默认的目标类型">默认的目标类型</h3>

<p>新版本中，如果用户没有对 target 设置 <code class="highlighter-rouge">set_kind</code> 指定目标类型，那么默认就是 binary 程序。</p>

<p>因此，我们可以实现更小的配置，例如：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">)</span>
</code></pre>
</div>

<p>只需两行就可以完成一些小项目的编译，甚至可以更加简短：</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">,</span> <span class="p">{</span><span class="n">files</span> <span class="o">=</span> <span class="s2">"src/*.c"</span><span class="p">})</span>
</code></pre>
</div>

<h3 id="新增-appletvos-编译平台">新增 appletvos 编译平台</h3>

<p>我们还新增了一个 appletvos 的编译平台，用于支持 Apple 的 TVOS 系统上程序的编译，只需要：</p>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f -p appletvos
</span><span class="w">$ </span><span class="nc">xmake</span><span class="kv">
</span></code></pre>
</div>

<h3 id="导入导出编译配置">导入导出编译配置</h3>

<p>我们还可以导入导出已经配置好的配置集，方便配置的快速迁移。</p>

<h4 id="导出配置">导出配置</h4>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f --export=/tmp/config.txt
</span><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f -m debug --xxx=y --export=/tmp/config.txt
</span></code></pre>
</div>

<h4 id="导入配置">导入配置</h4>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f --import=/tmp/config.txt
</span><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f -m debug --xxx=y --import=/tmp/config.txt
</span></code></pre>
</div>

<h4 id="导出配置带菜单">导出配置（带菜单）</h4>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f --menu --export=/tmp/config.txt
</span><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f --menu -m debug --xxx=y --export=/tmp/config.txt
</span></code></pre>
</div>

<h4 id="导入配置带菜单">导入配置（带菜单）</h4>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f --menu --import=/tmp/config.txt
</span><span class="w">$ </span><span class="nc">xmake</span><span class="kv"> f --menu -m debug --xxx=y --import=/tmp/config.txt
</span></code></pre>
</div>

<h3 id="vs2022-支持">vs2022 支持</h3>

<p>另外，新版本中，我们也增加了对 vs2020 预览版的支持。</p>

<h3 id="改进-xrepo-shell-环境">改进 xrepo shell 环境</h3>

<p>在上个版本，我们支持了通过在当前目录下，添加 xmake.lua 文件，来定制化一些包配置，然后进入特定的包 shell 环境。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">add_requires</span><span class="p">(</span><span class="s2">"zlib 1.2.11"</span><span class="p">)</span>
<span class="n">add_requires</span><span class="p">(</span><span class="s2">"python 3.x"</span><span class="p">,</span> <span class="s2">"luajit"</span><span class="p">)</span>
</code></pre>
</div>

<div class="language-console highlighter-rouge"><pre class="highlight"><code><span class="w">$ </span><span class="nc">xrepo</span><span class="kv"> env shell
</span>&gt; python --version
&gt; luajit --version
</code></pre>
</div>

<p>而现在，我们还可以在 xmake.lua 配置加载对应的工具链环境，比如加载 vs 的编译环境。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">set_toolchains</span><span class="p">(</span><span class="s2">"msvc"</span><span class="p">)</span>
</code></pre>
</div>

<h2 id="更新内容">更新内容</h2>

<h3 id="新特性">新特性</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/1421">#1421</a>: 针对 target 目标，增加目标文件名的前缀，后缀和扩展名设置接口。</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1422">#1422</a>: 支持从 vcpkg, conan 中搜索包</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1424">#1424</a>: 设置 binary 作为默认的 target 目标类型</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1140">#1140</a>: 支持安装时候，手动选择从第三包包管理器安装包</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1339">#1339</a>: 改进 <code class="highlighter-rouge">xmake package</code> 去产生新的本地包格式，无缝集成 <code class="highlighter-rouge">add_requires</code>，并且新增生成远程包支持</li>
  <li>添加 <code class="highlighter-rouge">appletvos</code> 编译平台支持, <code class="highlighter-rouge">xmake f -p appletvos</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1437">#1437</a>: 为包添加 headeronly 库类型去忽略 <code class="highlighter-rouge">vs_runtime</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1351">#1351</a>: 支持导入导出当前配置</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1454">#1454</a>: 支持下载安装 windows 预编译包</li>
</ul>

<h3 id="改进">改进</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/1425">#1425</a>: 改进 tools/meson 去加载 msvc 环境，并且增加一些内置配置。</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1442">#1442</a>: 支持从 git url 去下载包资源文件</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1389">#1389</a>: 支持添加工具链环境到 <code class="highlighter-rouge">xrepo env</code></li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1453">#1453</a>: 支持 protobuf 规则导出头文件搜索目录</li>
  <li>新增对 vs2022 的支持</li>
</ul>

<h3 id="bugs-修复">Bugs 修复</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/1413">#1413</a>: 修复查找包过程中出现的挂起卡死问题</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1420">#1420</a>: 修复包检测和配置缓存</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1445">#1445</a>: 修复 WDK 驱动签名错误</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/1465">#1465</a>: 修复缺失的链接目录</li>
</ul>


        </article>
        <hr>

        <!-- baidu ads -->
        

        <!-- reward -->
        <div style="text-align: center;">
            <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
              <span>赏</span>
            </button>
            <div id="QR" style="display: none;">
                <div id="wechat" style="display: inline-block">
                  <img id="wechat_qr" src="/static/img/weixin.png" alt="WeChat Pay"/>
                  <p>微信打赏</p>
                </div>
                <div id="alipay" style="display: inline-block">
                  <img id="alipay_qr" src="/static/img/alipay.png" alt="Alipay"/>
                  <p>支付宝打赏</p>
                </div>
            </div>
        </div>

        
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
                    
                    <h2 id="english">English</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/2021/06/30/xmake-update-v2.5.5/">xmake v2.5.5 released, Support to download and install precompiled image packages
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
        
            </ul>
        

        
        
            
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">相关文章</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/17/xmake-update-v2.6.2/">xmake v2.6.2 发布，新增 Linux 内核驱动模块构建支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 发布，使用 Lua5.4 运行时，Rust 和 C++ 混合编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 发布，改进 C++20 模块，并支持 Nim, Keil MDK 和 Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 发布，新增 Pascal/Swig 程序和 Lua53 运行时支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 发布，包依赖锁定和 Vala/Metal 语言编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        

        

        

        
        
        <p><strong>上一篇</strong> <a href="/cn/2021/05/15/xmake-update-v2.5.4/">xmake v2.5.4 发布，支持 apt/portage 包管理器，改进 xrepo shell 环境</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        <p><strong>下一篇</strong> <a href="/cn/2021/07/26/xmake-update-v2.5.6/">xmake v2.5.6 发布，改进预编译二进制镜像包兼容性</a></p>
        
    </div>
</div>


        <h2 id="comments">评论</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,       
  language: 'zh-CN',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">

            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    内容
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#english">English</a></li>
                    <li><a href="#similar_posts">相关文章</a></li>
                    <li><a href="#comments">评论</a></li>
                </ul>
            </div>


            <!-- baidu ads -->
            
            
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    链接
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- xmake courses -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    xmake 入门课程
                </div>
                <a href="https://xmake.io/#/zh-cn/about/course" target="_blank">
                <img src="/static/img/xmake-course.png" alt="course" width="256" height="193">
                </a>
            </div>

            <!-- qqgroup -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    技术交流群（QQ）
                </div>
                <img src="/static/img/qqgroup.png" alt="qqgroup" width="256" height="284">
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
